<template>
  <div>
    <!-- 页面介绍模块  -->
    <page-dec>
      <template v-slot:DescName>{{ viewDesc.viewDescTitle }}</template>
      <template v-slot:DescContent>{{ viewDesc.viewDescText }}</template>
    </page-dec>
    <!-- 产品描述模块 -->
    <div class="mainProductionDesc">
      <!-- 近期产品 -->
      <div class="recentProduction">
        <h5>{{ recentProduction.title }}</h5>
        <h3>{{ recentProduction.recentProduction }}</h3>
        <p>{{ recentProduction.recentProductionDesc }}</p>
      </div>
      <!-- 产品内容 -->
      <div class="productionContent">
        <div v-for="(item, i) in productionContent" :key="i">
          <div class="borderBox">
            <img :src="item.imgSrc" alt="产品图片" />
            <h3>{{ item.productionName }}</h3>
            <p>{{ item.productionText }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import pageDec from "@/components/pageDec.vue";
export default {
  components: {
    pageDec,
  },
  data() {
    return {
      // 页面描述数据
      viewDesc: {},
      // 近期产品
      recentProduction: {},
      // 产品内容
      productionContent: [],
    };
  },
  created() {
    this.createData();
  },
  methods: {
    //  页面数据获取
    async createData() {
      const { data: res } = await this.$axios.get("/OfficialWebsite/getPageOfRecPro");
      if (res.code === 200) {
        this.productionContent = res.data.productionDesc;
        this.recentProduction = res.data.productionTitle
        this.viewDesc = res.data.viewDesc
      }else{
        return false
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.mainProductionDesc {
  background-color: #f5fbff;
  padding-top: 0.625rem;
  padding-bottom: 3.125rem;
  .recentProduction {
    width: 38.4375rem;
    margin: 0 auto;
    margin-top: 8.875rem;
    h5 {
      //styleName: Heading/Heading 6;
      font-family: Inter;
      font-size: 1.25rem;
      font-weight: 600;
      line-height: 1.625rem;
      letter-spacing: 0em;
      text-align: center;
    }
    h3 {
      //styleName: Heading/Heading 2;
      margin-top: 1rem;
      font-family: Inter;
      font-size: 3rem;
      font-weight: 700;
      line-height: 4.125rem;
      letter-spacing: 0em;
      text-align: center;
    }
    p {
      margin-top: 1.4375rem;
      height: 3.125rem;
      width: 38.3125rem;
      left: 0.625rem;
      top: 9.625rem;
      border-radius: 0.625rem;
      text-align: center;
    }
  }
  .productionContent {
    display: flex;
    justify-content: center;
    margin-top: 6.25rem;
    // 边框盒子
    .borderBox {
      height: 47.25rem;
      width: 18.75rem;
      padding: 20px;
      background-color: #fff;
      border-radius: 10px;
      margin-left: 20px;
      padding-bottom: 20px;
      img {
        display: block;
        margin: 10px;
        height: 35.3125rem;
        width: 17.5rem;
      }
      h3 {
        //styleName: Heading/Heading 4;
        // font-family: Inter;
        font-size: 32px;
        font-weight: 700;
        line-height: 43px;
      }
      p {
        // display: block;
        margin-top: 20px;
        //styleName: Body/Defolt font;
        font-family: Inter;
        font-size: 16px;
        font-weight: 400;
        line-height: 25px;
        text-align: left;
        color: rgb(131, 131, 131);
      }
    }
  }
}
</style>
